import java.awt.*;

public class BoundingBox {

	int x, y, w, h;
	
	public BoundingBox(int x, int y, int w, int h) {
		this.x = x;
		this.y = y;
		this.w = w;
		this.h = h;
	}
	
	public BoundingBox(BoundingBox box) {
		this.x = box.x;
		this.y = box.y;
		this.w = box.w;
		this.h = box.h; 
	}
	
	public void centerpos(int x, int y) {
		this.x = x - w/2;
		this.y = y - h/2;
	}
	
	public void scale(int w, int h) {
		if(w < 0) w = 0;
		if(h < 0) h = 0;
		this.w = w;
		this.h = h;
	}
	
	public void draw(Graphics2D g) {
		g.drawRect(this.x, this.y, w, h);
	}

}
